<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>

<?php
include("session.php");

include("Conexao.php");
include("Fabricante.php");
$conexao = new Conexao();
$fabricante = new Fabricante();
$codigo = $_GET["codigo"];

$con = $conexao->conectBD();


$sql = "SELECT * FROM tbfabricante WHERE codigo = $codigo";

$result = pg_query($sql);


$fabricante->setCodigo($codigo);

$fabricante->setNome(pg_fetch_result($result, 0, "nome"));
echo("$codigo");
$fabricante->setPais(pg_fetch_result($result, 0, "pais")); 

$conexao->desconectBD();

?>


<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <LINK REL=StyleSheet HREF="main.css" TYPE="text/css" MEDIA=screen>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>   
    <link rel="stylesheet" href="main.css" />
    </head>
    <body>
        <table border="0" style="border: 1px solid #ccc;" align="center" width="100%">
            <tbody>
                <tr>
                    <td colspan="2" align="center">
                        <strong>Dados do fabricante</strong>
                    </td>
                </tr>
                <tr>
                    <td align="right">Código: </td>
                    <td align="center"><input type="text" name="codigo" value="<?php echo $fabricante->getCodigo(); ?>" readonly="readonly" /> </td>
                </tr>
                <tr>
                    <td align="right">Nome: </td>
                    <td align="center"><input type="text" name="nome" value="<?php echo $fabricante->getNome(); ?>" readonly="readonly" /> </td>
                </tr>
                <tr>
                    <td align="right">País: </td>
                    <td align="center"><textarea name="pais" rows="2" cols="20" readonly="readonly">
                            <?php echo $fabricante->getPais(); ?>
                        </textarea></td>
                </tr>
            </tbody>
        </table>

        
    </body>
</html>